home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / cpvTexture.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  20.6 KB  |  444 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. // Copyright (C) 1997-2001 Alias|Wavefront,
  18. // a division of Silicon Graphics Limited.
  19. //
  20. // The information in this file is provided for the exclusive use of the
  21. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  22. // and incorporate this code into other products for purposes authorized
  23. // by the Alias|Wavefront license agreement, without fee.
  24. //
  25. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  26. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  27. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  28. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  29. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  30. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  31. // PERFORMANCE OF THIS SOFTWARE.
  32. //
  33. //
  34. //  Alias|Wavefront Script File
  35. //
  36. //  Creation Date:    March 13, 2001
  37. //  Modified:        April 6, 2001
  38. //  Creator:        Tom Kluyskens tkluyskens@aw.sgi.com tkluysk@hotmail.com
  39. //
  40. //
  41. //  Procedure Name:
  42. //    cpvTexture
  43. //
  44. //  Description :
  45. //    Creates a layered texture or a surface shader for the selected surfaces.
  46. //    The texture or shader contains color per vertex info.
  47. //    It allows software rendering of color per vertex.
  48. //
  49. //  Input Value:
  50. //    none
  51. //
  52. //  Output Value:
  53. //    None
  54. // 
  55.  
  56.  
  57.  
  58. global proc createCPVtextures(int $undo , int $noHistory , int $deleteUnused , int $cpvTrsp , int $cpvPS2 , string $cpvShader , string $channel)
  59. {
  60.         
  61.         
  62.     if ($channel == "cpvInc") {
  63.                $channel = "incandescence";
  64.     } else {
  65.         $channel = "ambientColor";
  66.     }
  67.     
  68.     $cpvTrsp = 1-$cpvTrsp;
  69.     
  70.     // delete unused shading nodes (speeds up things in case there's dangling UVchooser nodes)
  71.     if ($deleteUnused) MLdeleteUnused;
  72.     
  73.     // Disable undo queue for reducing memory usage.
  74.     // Applying script to big meshes rapidly fills memory with undo information.    
  75.     if ($undo) undoInfo -state off;
  76.  
  77.         
  78.         // create cpv texture for selected meshes
  79.         $meshes = `ls -sl`;
  80.         
  81.         // get shape nodes (selection is very probably transforms only)
  82.         $meshes = `listRelatives -s $meshes`;
  83.         $meshes = `ls -typ mesh $meshes`;
  84.         
  85.         // create a layered texture per selected mesh
  86.         string $colorMesh = "";
  87.         for ($colorMesh in $meshes) {
  88.             
  89.             // delete history on selected surface
  90.         if ($noHistory) delete -ch $colorMesh;
  91.             
  92.             print ("\n\nCreating vertex color texture for " + $colorMesh +"...");
  93.         text -e -l ("Creating vertex colors for " + $colorMesh +"...") cpvTxt;
  94.             
  95.             // store current UV set for reset at end of the script
  96.             $currentSet = `polyUVSet -q -currentUVSet $colorMesh`;
  97.         
  98.         // gather info about the mesh
  99.                 int $numVtx[] = `polyEvaluate -v $colorMesh`;
  100.                 int $numFcs[] = `polyEvaluate -f $colorMesh`;
  101.                 $numFcs[0] -=1;
  102.                 string $allFcs = $colorMesh + ".f[0:" + $numFcs[0] + "]";
  103.         
  104.         
  105.         // get the exact attribute indices for the RG and BA UVsets
  106.                 string $allSets[] = `polyUVSet -q -allUVSets $colorMesh`;
  107.                 int $RGsetIndex = $BAsetIndex = -1;
  108.                 for ($i = 0 ; $i < size($allSets) ; $i++) {
  109.                     if ($allSets[$i] == "RG") $RGsetIndex = $i;
  110.                     if ($allSets[$i] == "BA") $BAsetIndex = $i;
  111.                 }
  112.               
  113.  
  114.         //  create the RG (red green) UV set on this mesh if it does not exist yet
  115.                 if ($RGsetIndex < 0) {
  116.                     polyUVSet -create -uvSet "RG" $colorMesh;
  117.                     
  118.                     // make sure there's actual UVs by doing a UV projection
  119.                     polyProjection -type planar -ibd 1 -md x -uvSetName "RG" $allFcs;
  120.                     $allSets = `polyUVSet -q -allUVSets $colorMesh`;
  121.                     $RGsetIndex = size($allSets) - 1;
  122.                 }
  123.                 
  124.                 // same for BA (blue alpha)
  125.                 if ($BAsetIndex < 0) {
  126.                     polyUVSet -create -uvSet "BA" $colorMesh;
  127.                 polyProjection -type planar -ibd 1 -md x -uvSetName "BA" $allFcs;
  128.                     $allSets = `polyUVSet -q -allUVSets $colorMesh`;
  129.                     $BAsetIndex = size($allSets) - 1;
  130.             }
  131.             
  132.             // set RA to be the current UV set
  133.         polyUVSet -currentUVSet -uvSet "RG" $colorMesh;
  134.         if ($noHistory) delete -ch $colorMesh;
  135.           
  136.                 for ($i = 0 ; $i < $numVtx[0] ; $i++) {
  137.                         
  138.                         // for all vertices, copy the red and green color per vertex into the U and V values of the RG UV set
  139.                         if (fmod($i-1,100) == 0) {
  140.                             print ("\n   copying R and G for vertex " + $i + " of " + $numVtx[0] +"...");
  141.                 text -e -l ("copying R and G for vertex " + $i + " of " + $numVtx[0] +"...") cpvTxt;
  142.                         }
  143.                         float $RG[] = `polyColorPerVertex -q -r -g ($colorMesh + ".vtx[" + $i + "]")`;
  144.                         
  145.                         // rescale colors for PS2
  146.                         if ($cpvPS2) {
  147.                             if ($RG[0] > .5) $RG[0] = 3*$RG[0]-1;
  148.                             if ($RG[1] > .5) $RG[1] = 3*$RG[1]-1;
  149.                         }
  150.                         
  151.                         polyEditUV -r 0 -u $RG[0] -v $RG[1] `polyListComponentConversion -fv -tuv ($colorMesh + ".vtx[" + $i + "]")`;
  152.                        
  153.                 }
  154.  
  155.                 // same, for blue and alpha
  156.                 polyUVSet -currentUVSet -uvSet "BA" $colorMesh;
  157.         if ($noHistory) delete -ch $colorMesh;
  158.             
  159.                 for ($i = 0 ; $i < (float)$numVtx[0] ; $i++) {
  160.                         
  161.                         if (fmod($i-1,100) == 0) {
  162.                             print ("\n   copying B and A for vertex " + $i + " of " + $numVtx[0] +"...");
  163.                 text -e -l ("copying B and A for vertex " + $i + " of " + $numVtx[0] +"...") cpvTxt;
  164.                         }
  165.                         float $BA[] = `polyColorPerVertex -q -b -a ($colorMesh + ".vtx[" + $i + "]")`;
  166.                         
  167.                         // rescale colors for PS2
  168.                         if ($cpvPS2) if ($BA[0] > .5) $BA[0] = 3*$BA[0]-1;
  169.                         
  170.                         // revert the alpha into transparency for use with a surface shader
  171.                         if ($cpvTrsp) if ($cpvShader == "cpvNew") $BA[1] = 1 - $BA[1];
  172.                         
  173.                         polyEditUV -r 0 -u $BA[0] -v $BA[1] `polyListComponentConversion -fv -tuv ($colorMesh + ".vtx[" + $i + "]")`;
  174.                        
  175.                 }
  176.                 
  177.                 
  178.                
  179.                 // create and connect UVchooser nodes if they don't exists yet
  180.                 string $RGch = $colorMesh + "RGchooser";
  181.                 string $BAch = $colorMesh + "BAchooser";
  182.                 if (!`objExists $RGch`) $RGch = `createNode uvChooser -n ($colorMesh + "RGchooser")`;
  183.                 if (!`objExists $BAch`) $BAch = `createNode uvChooser -n ($colorMesh + "BAchooser")`;
  184.                 connectAttr -f ($colorMesh + ".uvSet[" + $BAsetIndex + "].uvSetName") ($RGch + ".uvSets[0]");  // to avoid 'already connected' error
  185.                 connectAttr -f ($colorMesh + ".uvSet[" + $RGsetIndex + "].uvSetName") ($BAch + ".uvSets[0]");  // to avoid 'already connected' error
  186.                 connectAttr -f ($colorMesh + ".uvSet[" + $RGsetIndex + "].uvSetName") ($RGch + ".uvSets[0]");
  187.                 connectAttr -f ($colorMesh + ".uvSet[" + $BAsetIndex + "].uvSetName") ($BAch + ".uvSets[0]");
  188.  
  189.  
  190.         if ($cpvShader == "cpvNew") {
  191.                         
  192.             // create 1 CPV surface shader per mesh
  193.             // following network structure is being built :
  194.             // mesh -> UVchooser -> placement2d -> surface shader
  195.             
  196.             // create and assign a surface shader
  197.                     string $cpvSS = $colorMesh + "CPVshader";
  198.                     string $cpvSG = $cpvSS + "SG";
  199.                     if (!`objExists $cpvSS`) { 
  200.                         $cpvSS = `shadingNode -asShader surfaceShader`;
  201.                         $cpvSS = `rename $cpvSS ($colorMesh + "CPVshader")`;
  202.                     }
  203.                     if (!`objExists $cpvSG`) { 
  204.                         $cpvSG = `sets -renderable true -noSurfaceShader true -empty -name ($cpvSS + "SG")`;
  205.                 connectAttr -f ($cpvSS + ".outColor") ($cpvSG + ".surfaceShader");
  206.             }
  207.             select -r $colorMesh;
  208.                     sets -e -forceElement $cpvSG;
  209.                     
  210.                     // create two placements (necessary to translate UVs into actual RG and BA color values)
  211.                     string $RGpl = $cpvSS + "RGplacement";
  212.                     string $BApl = $cpvSS + "BAplacement";
  213.                     if (!`objExists $RGpl`) $RGpl = `createNode place2dTexture -n ($cpvSS + "RGplacement")`;
  214.                     if (!`objExists $BApl`) $BApl = `createNode place2dTexture -n ($cpvSS + "BAplacement")`;
  215.                     
  216.                     // connect the UVchoosers to the placements
  217.                     connectAttr -f ($BAch + ".outUv") ($RGpl + ".uvCoord");  // to avoid 'already connected' error
  218.                     connectAttr -f ($RGch + ".outUv") ($BApl + ".uvCoord");  // to avoid 'already connected' error
  219.                     connectAttr -f ($RGch + ".outUv") ($RGpl + ".uvCoord");
  220.                     connectAttr -f ($BAch + ".outUv") ($BApl + ".uvCoord");
  221.                     
  222.                     // connect the placements to the surface shader
  223.                     connectAttr -f ($RGpl + ".outV") ($cpvSS + ".outColorR");  // to avoid 'already connected' error
  224.                     connectAttr -f ($RGpl + ".outU") ($cpvSS + ".outColorG");  // to avoid 'already connected' error
  225.                     connectAttr -f ($BApl + ".outV") ($cpvSS + ".outColorB");  // to avoid 'already connected' error
  226.                     connectAttr -f ($BApl + ".outU") ($cpvSS + ".outTransparencyR");  // to avoid 'already connected' error
  227.                     connectAttr -f ($BApl + ".outU") ($cpvSS + ".outTransparencyG");  // to avoid 'already connected' error
  228.                     connectAttr -f ($BApl + ".outU") ($cpvSS + ".outTransparencyB");  // to avoid 'already connected' error
  229.                     connectAttr -f ($RGpl + ".outU") ($cpvSS + ".outColorR");
  230.                     connectAttr -f ($RGpl + ".outV") ($cpvSS + ".outColorG");
  231.                     connectAttr -f ($BApl + ".outU") ($cpvSS + ".outColorB");
  232.                     if ($cpvTrsp) {
  233.                         connectAttr -f ($BApl + ".outV") ($cpvSS + ".outTransparencyR");
  234.                         connectAttr -f ($BApl + ".outV") ($cpvSS + ".outTransparencyG");
  235.                         connectAttr -f ($BApl + ".outV") ($cpvSS + ".outTransparencyB");
  236.                     } else {
  237.                         disconnectAttr ($BApl + ".outU") ($cpvSS + ".outTransparencyR");
  238.                         disconnectAttr ($BApl + ".outU") ($cpvSS + ".outTransparencyG");
  239.                         disconnectAttr ($BApl + ".outU") ($cpvSS + ".outTransparencyB");
  240.                         setAttr ($cpvSS + ".outTransparencyR") 0;
  241.                         setAttr ($cpvSS + ".outTransparencyG") 0;
  242.                         setAttr ($cpvSS + ".outTransparencyB") 0;
  243.                     }
  244.                     
  245.                 print ("\nCreated and assigned CPV shader " + $cpvSS + " to " + $colorMesh + ".");
  246.                   
  247.                 } else {
  248.                     
  249.             // keep existing shaders
  250.             // following network structure is being built :
  251.             // mesh -> UVchooser -> doubleSwitch -> placement2d -> layered texture -> material
  252.             
  253.             // cycle through all materials assigned to this mesh
  254.             for ($mat in `getAssignedMaterials ($colorMesh)`) {
  255.             
  256.                 // create and assign 1 CPV layered texture per shader
  257.                 string $rgbaLT = $mat + "cpvTexture";
  258.                         if (!`objExists $rgbaLT`) $rgbaLT = `createNode layeredTexture -n ($mat + "cpvTexture")`;
  259.                         
  260.                         // create two placements per shader (necessary to translate UVs into actual RG and BA color values)
  261.                         string $RGpl = $mat + "RGplacement";
  262.                         string $BApl = $mat + "BAplacement";
  263.                         if (!`objExists $RGpl`) $RGpl = `createNode place2dTexture -n ($mat + "RGplacement")`;
  264.                         if (!`objExists $BApl`) $BApl = `createNode place2dTexture -n ($mat + "BAplacement")`;
  265.                         
  266.                         // create two switch nodes per shader (so we can use the same layered texture for different incoming UVchooser nodes)
  267.                         string $RGsw = $mat + "RGswitch";
  268.                         string $BAsw = $mat + "BAswitch";
  269.                         if (!`objExists $RGsw`) {
  270.                             $RGsw = `createNode doubleShadingSwitch -n ($mat + "RGswitch")`;
  271.                             addAttr -k 1 -ln counter -at short -dv 0 $RGsw;
  272.                         }
  273.                         if (!`objExists $BAsw`) {
  274.                             $BAsw = `createNode doubleShadingSwitch -n ($mat + "BAswitch")`;
  275.                             addAttr -k 1 -ln counter -at short -dv 0 $BAsw;
  276.                         }
  277.                         
  278.                         // this counter attribute helps us to track the number of connections to both switches
  279.                         $cpvCounter = `getAttr ($RGsw + ".counter")`;
  280.                 
  281.                 // check if the mesh is already connected to the switch nodes
  282.                 int $cpvConnect = -1;
  283.                 for ($i = 0 ; $i < $cpvCounter ; $i++) {
  284.                     $cpvListConn = `listConnections -p 1 -c 1 ($RGsw + ".input[" + $i + "].inShape")`;
  285.                     if ($cpvListConn[1] == ($colorMesh + ".instObjGroups")) $cpvConnect = $i;
  286.                 }
  287.                 
  288.                 // connect the mesh and the UVchoosers to the switches if they're not already connected
  289.                 if ($cpvConnect == -1) {
  290.                     connectAttr -f ($colorMesh + ".instObjGroups[0]") ($RGsw + ".input[" + $cpvCounter + "].inShape");
  291.                     connectAttr -f ($colorMesh + ".instObjGroups[0]") ($BAsw + ".input[" + $cpvCounter + "].inShape");
  292.                     connectAttr -f ($RGch + ".outUv") ($RGsw + ".input[" + $cpvCounter + "].inDouble");
  293.                     connectAttr -f ($BAch + ".outUv") ($BAsw + ".input[" + $cpvCounter + "].inDouble");
  294.                     setAttr ($RGsw + ".counter") ($cpvCounter + 1);
  295.                 }
  296.             
  297.                         // connect the UVchoosers to the placements
  298.                         connectAttr -f ($BAsw + ".output") ($RGpl + ".uvCoord");  // to avoid 'already connected' error
  299.                         connectAttr -f ($RGsw + ".output") ($BApl + ".uvCoord");  // to avoid 'already connected' error
  300.                         connectAttr -f ($RGsw + ".output") ($RGpl + ".uvCoord");
  301.                         connectAttr -f ($BAsw + ".output") ($BApl + ".uvCoord");
  302.  
  303.                 // break existing connections of layered texture with shaders
  304.                 $cpvConnections = `listConnections -s 0 -d 1 -p 1 $rgbaLT`;
  305.                 for ($i = 0 ; $i < size($cpvConnections) ; $i++) disconnectAttr ($rgbaLT + ".outColor") $cpvConnections[$i];
  306.                 
  307.                         // make connections between layered texture and material
  308.                         connectAttr -f ($RGpl + ".outV") ($rgbaLT + ".inputs[0].colorR");  // to avoid 'already connected' error
  309.                         connectAttr -f ($RGpl + ".outU") ($rgbaLT + ".inputs[0].colorG");  // to avoid 'already connected' error
  310.                         connectAttr -f ($BApl + ".outV") ($rgbaLT + ".inputs[0].colorB");  // to avoid 'already connected' error
  311.                         connectAttr -f ($BApl + ".outU") ($rgbaLT + ".inputs[0].alpha");  // to avoid 'already connected' error
  312.                         connectAttr -f ($RGpl + ".outU") ($rgbaLT + ".inputs[0].colorR");
  313.                         connectAttr -f ($RGpl + ".outV") ($rgbaLT + ".inputs[0].colorG");
  314.                         connectAttr -f ($BApl + ".outU") ($rgbaLT + ".inputs[0].colorB");
  315.                         if ($cpvTrsp) {
  316.                             connectAttr -f ($BApl + ".outV") ($rgbaLT + ".inputs[0].alpha");
  317.                         } else {
  318.                             disconnectAttr ($BApl + ".outU") ($rgbaLT + ".inputs[0].alpha");
  319.                             setAttr ($rgbaLT + ".inputs[0].alpha") 1;
  320.                         }
  321.                         
  322.                     print ("\nCreated layered texture " + $rgbaLT + ".");
  323.                     
  324.                 if (`attributeQuery -ex -n $mat $channel`) {
  325.                     connectAttr -f ($rgbaLT + ".outColor") ($mat + "." + $channel);
  326.                 } else {
  327.                     print ("\nWARNING : No " + $channel + " channel on material " + $mat + ".  Leaving " + $rgbaLT + " unconnected.");
  328.                 }
  329.                 
  330.             }
  331.             
  332.         }
  333.         
  334.                 // reset the original UVset on this mesh
  335.                 polyUVSet -currentUVSet -uvSet $currentSet $colorMesh;        
  336.             
  337.             
  338.             // delete history on selected surface
  339.         if ($noHistory) delete -ch $colorMesh;
  340.         
  341.         }
  342.  
  343.     print ("\n\nVertex color copying finished...\n");
  344.     
  345.     // delete unused shading nodes
  346.     if ($deleteUnused) MLdeleteUnused;
  347.     
  348.     // put undo queue back on
  349.     if ($undo) undoInfo -state on;
  350.  
  351.  
  352. }
  353.  
  354.  
  355. global proc string[] getAssignedMaterials(string $mesh)
  356. {
  357. // gets all the materials assigned to this mesh
  358.     
  359.     
  360.     string $retval[];
  361.     clear $retval;
  362.     
  363.     string $plugs[] = `listConnections -s false -d true $mesh`;
  364.  
  365.     // Look for a connected shading engine - this is
  366.     // the jumping off point to get to the rendering nodes
  367.     // from a selected surface
  368.  
  369.     for( $plug in $plugs ) {
  370.         if ( `nodeType $plug` == "shadingEngine" ) {
  371.  
  372.             // Get the shading engine that's connected to this
  373.             // mesh node, and get the material connected to it
  374.  
  375.             string $tmp[] = `listConnections ( $plug + ".surfaceShader" )`;
  376.             if( $tmp[0] != "" ) $retval[size($retval)] = $tmp[0];
  377.         }
  378.     }
  379.     
  380.     
  381.     $retval = AWRemoveDuplicateStringsFromStringArray ($retval);
  382.     
  383.     return $retval;
  384.     
  385. }
  386.  
  387.  
  388.  
  389.  
  390.  
  391. global proc cpvTexture()
  392. {
  393. // create interface
  394.  
  395.     if (`window -exists "cpvWindow"`) deleteUI -window "cpvWindow";
  396.  
  397.     window -wh 300 325 -s 0 -t " CPV Texture     -    by  Tom Kluyskens" "cpvWindow";
  398.         frameLayout -lv 0 -bs "etchedOut";
  399.         columnLayout -co "both" 10 -adj 1;
  400.         
  401.             text -l " ";
  402.             
  403.             // disable undo for less memory usage - default OFF
  404.             checkBox -l "Disable Undo   (requires less memory)" -v 0 -al "left" -onc "text -e -l \"CAUTION : flushes entire undo queue!\" cpvTxt;" cpvUndo;
  405.             
  406.             // delete history on the meshes (faster, less clutter) - default OFF
  407.             checkBox -l "Delete History on Mesh  (faster)" -v 0 -al "left" -onc "text -e -l \"CAUTION : deleting history destroys skinning!\" cpvTxt;" cpvHist;
  408.             
  409.             // delete unused shading nodes (UVchoosers of previous script execution for example) - default OFF
  410.             checkBox -l "Delete Unused Shading Nodes" -v 0 -al "left" -onc "text -e -l \"CAUTION : deletes all unassigned shading nodes!\" cpvTxt;" cpvUnus;
  411.             
  412.             text -l " ";
  413.             
  414.             // automatically connect layered texture to incandescence of all assigned shaders (default)
  415.             // or create a surface shader for every selected mesh
  416.             radioCollection cpvShaders;
  417.                 radioButton -l "Create and Assign New CPV Shader" -al "left" -onc "columnLayout -e -vis 0 cpvDimmer ; text -e -l \"CAUTION : unassigns all existing shaders!\" cpvTxt;" cpvNew;
  418.                 radioButton -l "Auto-connect Vertex Color to Existing Shader" -sl -al "left" -onc "columnLayout -e -vis 1 cpvDimmer" cpvConnect;
  419.                 
  420.                 columnLayout -cal left -co left 50 cpvDimmer;
  421.                 radioCollection cpvChannel;
  422.                     radioButton -sl -l "to Incandescence" cpvInc;
  423.                     radioButton -l "to Ambient" cpvAmb;
  424.                 setParent ..;
  425.             
  426.             text -l " ";
  427.             
  428.             // no transparency calculation - default OFF
  429.             checkBox -l "No Transparency" -v 0 -al "left" cpvTrsp;
  430.             // preview PS2 color values - default OFF
  431.             checkBox -l "Simulate PS2 Color Values" -v 0 -al "left" cpvPS2;
  432.             
  433.             text -l " ";
  434.             
  435.             $btnCmd = "button -e -l \"wait ...\" cpvBtn ; createCPVtextures `checkBox -q -v cpvUndo` `checkBox -q -v cpvHist` `checkBox -q -v cpvUnus` `checkBox -q -v cpvTrsp` `checkBox -q -v cpvPS2` `radioCollection -q -sl cpvShaders` `radioCollection -q -sl cpvChannel`; deleteUI -window \"cpvWindow\";";
  436.             button -l "Create Texture" -c $btnCmd cpvBtn;
  437.     
  438.             text -l " ";
  439.             text -l " Send bugs and sugs to tkluyskens@aw.sgi.com" cpvTxt;
  440.     
  441.     showWindow "cpvWindow";
  442.     
  443. }
  444.